<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        window.onload = function () {
            var div = document.createElement("div"); // 创建在内存中
            div.innerHTML = "ABC"
            console.log(div);
            document.body.appendChild(div);
           /* 与以下代码等价：
           var bodys = document.getElementsByTagName("body");
            bodys[0].appendChild(div);*/

            var div2 = document.createElement("div");
            div2.appendChild(document.createTextNode("div2Text"));
            div.append(div2);
        }
    </script>
</head>
<body>

</body>
</html>